/*
 * Created on Sep 7, 2008
 */
package com.mgmaps.platform;

import javax.microedition.media.Control;

public interface IPlatformHandler {
  
  public int AUDIO_PATH_HANDSET = 0;
  public int AUDIO_PATH_HANDSFREE = 1;
  public int AUDIO_PATH_BLUETOOTH = 2;
  public int AUDIO_PATH_HEADSET = 3;
  public int AUDIO_PATH_HEADSET_HANDSFREE = 4;
  public int AUDIO_PATH_BLUETOOTH_A2DP = 5;
  
  /**
   * Vibrate.
   * @param length vibration length in milliseconds
   */
  public void vibrate(final int length);
  
  /**
   * Set audio path control
   * @param controls media controls available for the player
   * @param device device to route audio to
   * @return true if successful, false otherwise
   */
  public boolean setAudioPath(Control[] controls, int device);
  
  /**
   * Set volume.
   * @param vol volume level, 0 = minimum, 100 = maximum.
   */
  public void setVolume(int vol);
  
  /**
   * Get device id.
   * @return device id for blackberry
   */
  public String getDeviceID();
  
  /**
   * Get device name.
   * @return device name for blackberry
   */
  public String getDeviceName();
  
  /**
   * Get user agent.
   * @return user agent for blackberry
   */
  public String getUserAgent();
  
  /**
   * Get carrier name.
   * @return name of carrier (could be null)
   */
  public String getCarrierName();
  
  /**
   * Get phone number.
   * @return phone number (could be null)
   */
  public String getPhoneNumber();
  
  /**
   * Set backlight always on.
   */
  public void backlightOn();
  
  /**
   * Turn backlight off at exit.
   */
  public void backlightOff();

  /**
   * Get extension string.
   * @return HTTP extension string, "" for non-blackberry
   */
  public String getBlackberryHTTPExtension();
  
  /**
   * Open a website in the default browser.
   * @param url URL to open
   */
  public void openWebsite(String url);
}
